GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

handleActions.js ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
nc 1
dl 0
loc 5
rs 9.4285
nop 1
1
const TYPE_ERROR = 'handleActions: Action Types should be not be undefined';
2
const ACTION_ERROR = 'handleActions: action object should be not be undefined';
3
4
export const handleActions = (map, initialState) => {
0 ignored issues
show
Unused Code introduced by
The parameter initialState is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
5
    Object.keys(map).forEach(key => {
6
        if (key === 'undefined') {
7
            throw new Error(TYPE_ERROR);
8
        }
9
    });
10
11
    return (state = initialState, action) => {
12
        if (!action) {
13
            throw new Error(ACTION_ERROR);
14
        }
15
16
        if (action.type === undefined) {
17
            throw new Error(TYPE_ERROR);
18
        }
19
20
        const reducerSubFunction = map[action.type];
21
22
        if (typeof reducerSubFunction === 'function') {
23
            return reducerSubFunction(state, action);
24
        }
25
26
        return state;
27
    };
28
};
29
30
export default handleActions;
31